package com.sias.questionservice.controller.inner;

import com.sias.model.model.entity.Question;
import com.sias.model.model.entity.QuestionSubmit;
import com.sias.questionservice.service.QuestionService;
import com.sias.questionservice.service.QuestionSubmitService;
import com.sias.serviceclient.service.QuestionFeignClient;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 吴文杰
 * @version 1.0
 * @since 2023/12/14 19:48
 */
@RestController
@RequestMapping("/inner")
public class QuestionInnerController implements QuestionFeignClient {

  @Resource
  QuestionService questionService;

  @Resource
  QuestionSubmitService questionSubmitService;

  @GetMapping("/question_submit/get/id")
  @Override
  public QuestionSubmit getQuestionSubmitById(@RequestParam("questionSubmitId")long questionSubmitId) {
    return questionSubmitService.getById(questionSubmitId);
  }

  @GetMapping("/get/id")
  @Override
  public Question getQuestionById(@RequestParam("questionId") Long questionId) {
    return questionService.getById(questionId);
  }

  @GetMapping("/question_submit/update")
  @Override
  public boolean updateQuestionSubmitById(@RequestBody QuestionSubmit questionSubmitUpdate) {
    return false;
  }
}
